Ext.define('Ext.app.CellEditing', {
    extend: 'Ext.grid.Panel',
    
    requires: [
        'Ext.selection.CellModel',
        'Ext.grid.*',
        'Ext.data.*',
        'Ext.util.*',
        'Ext.form.*'
    ],
    xtype: 'cell-editing',
    
    initComponent: function() {
        this.cellEditing = new Ext.grid.plugin.CellEditing({
            clicksToEdit: 1
        });
        
        Ext.apply(this, {
            plugins: [this.cellEditing],
            selModel: {
                selType: 'cellmodel'
            }
        });
        
        this.callParent();
    },
    
    addRow: function(record, startEditColumn) {
        this.cellEditing.completeEdit();
        record.stt = this.getStore().count() + 1;
        this.getStore().add(record);
        var row = this.getStore().count() - 1;
        this.cellEditing.startEditByPosition({
            row: row, 
            column: startEditColumn
        });
    }
})